﻿<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" import="org.apache.commons.lang.StringEscapeUtils"%>
<%@ include file="/WEB-INF/taglibs.jsp"%>
<link href="${ctx}/resource/system/common/css/pagination.css" rel="stylesheet" type="text/css" />
<script src="${ctx}/resource/system/common/js/jquery.pagination.js"></script>
<script type="text/javascript">
	$(function(){
		$("#serveMenu").addClass("cur");
	});	
	
	
	//分页
	function handlePaginationClick(new_page_index, pagination_container) {	   	    
		   window.location.href = "${ctx}/admin/serveInfo/index.htm?pageNum="+(new_page_index+1)+"&pageSize=${page.pageSize}";
		    return false;  
	}
	
	$(function(){
		$("#News-Pagination").pagination(
			'${page.total}', 			
			{items_per_page:'${page.pageSize}', // 每页显示多少条记录
				current_page:'${page.currentPage}' - 1, // 当前显示第几页数据
				num_display_entries:8, // 分页显示的条目数
				next_text:"下一页",
				prev_text:"上一页",
				num_edge_entries:2, // 连接分页主体，显示的条目数
				callback:handlePaginationClick
			}
		);		
	});
</script>

<div class="conTit fixed">
	<p>服务管理</p>
</div>

<table class="theTable">
    <thead>
        <tr>
        	<th width="8%">序号</th>
        	<th>服务名称</th>
        	<th>联系人</th>
        	<th>联系电话</th>
        	<th>服务状态</th>
        	<th>发布时间</th>
        	<th width="100">操作</th>
        </tr>
    </thead>
    <tbody>
     	<c:forEach items="${page.rows}" var="o" varStatus="status">
	        <tr>
	        	<td>${(page.currentPage-1)*page.pageSize + status.count}</td>
	        	<td>${o.title}</td>
	        	<td>${o.contactName}</td>
	        	<td>${o.contactPhone}</td>
	        	<td>
		        	<c:if test="${o.serveStatus == 1}">
		        		正在进行中
		        	</c:if>
		        	<c:if test="${o.serveStatus == 2}">
		        		已结束
		        	</c:if>
	        	</td>
	        	<td>${o.createTime}</td>
		        <td>
		        	<a href="${ctx}/admin/serveInfo/serveInfoDetail.htm?serveId=${o.id}" class="backBtn">查看</a>		        			        	
		        </td>
	        </tr>
        </c:forEach>
    </tbody>
</table>
<div id="News-Pagination"></div>